package com.yh.patterns.state.job;

/**
 * @Author:云尚
 * @Description:熟练级状态类
 */
public class SecondaryState extends State{
    public SecondaryState(State primaryState) {
        this.player=primaryState.player;
        this.point=primaryState.point;
        this.rankName="熟练级";
    }

    public void doubleScore(){
        System.out.println(rankName+"玩家"+player.getName()+"使用积分翻倍+20");
        point+=20;
        checkState(point);
    }
    @Override
    public void checkState(int point) {
        if(point<30){
            player.setState(new PrimaryState(this));
        }else if(point>=50){
            player.setState(new ProfessionalState(this));
        }
    }
}
